package com.tongcao.cn.config;

import com.tongcao.cn.filter.AFilter;
import com.tongcao.cn.filter.BFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author:tongcao
 * @Date:2018/8/23 17:57
 * Description:order的数值越小，优先级越高
 */
@Configuration
public class FilterConfigure {

    @Bean
    public FilterRegistrationBean buildAFilter() {
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
        filterRegistrationBean.setFilter(new AFilter());
        return filterRegistrationBean;
    }

    @Bean
    public FilterRegistrationBean buildBFilter() {
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
        filterRegistrationBean.setFilter(new BFilter());
        return filterRegistrationBean;
    }


}
